**Schooling Effects of Cocoa Price
clear
clear matrix
clear mata
cap log close
************************************************************************************
**change directory here
* DIRECTORY ROADMAP
sysdir set PLUS C:\ado\plus\c
************************************************************************************

global dir1 C:\Users\hab55\Dropbox\Second_paper_Ghana\2023_EDCC_Price\Data
global dir2 C:\Users\hab55\Dropbox\Second_paper_Ghana\2023_EDCC_Price\Do
global dir3 C:\Users\hab55\Dropbox\Second_paper_Ghana\2023_EDCC_Price\Output

///////////////////////////////////////////////////////////////////////////////
use "$dir1\schooling_final_data", clear
///////////////////////////////////////////////////////////////////////////////
///Main results 
***Table 1
**Attendance
//Panel A: without trend 
////all
areg attendance shockc  i.agey gender genderhd i.year i.YOB [aw=weight], ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) pdec(2)  nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)

//////////////////////////////////////////////////////////////////////////////////
///primary
areg attendance shockc  i.agey  gender genderhd i.year i.YOB [aw=weight] if agey<=11, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)

/////////////////////////////////////////////////////////////////////////
////juniour
areg attendance shockc  i.agey  gender genderhd i.year i.YOB [aw=weight] if agey>11 & agey<=14, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)

///seniour
areg attendance shockc  i.agey gender genderhd i.year i.YOB [aw=weight] if agey>14, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)

////////////////////////////////////////////////////////////////////////
///Panel B: with trend 
////all

areg attendance shockc  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight], ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
//////////////////////////////////////////////////////////////////////////////////
///primary

areg attendance shockc  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey<=11, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
/////////////////////////////////////////////////////////////////////////
////juniour

areg attendance shockc  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>11 & agey<=14, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
//////////////////////////////////////////////////////////////////////////////
///seniour

areg attendance shockc  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>14, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\education_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

//////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
***Grade-for-age//ontrack
///Panel C: without trend 

areg ontrack shockc1  i.agey gender genderhd i.year i.YOB [aw=weight], ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  

outreg2 using "$dir3\education1_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)

/////////////////////////////////////////////////////////////////////////////
///primary
areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB [aw=weight] if agey<=11, ab (ROB) cluster (ROB)
boottest shockc1=0 ,  nograph   

outreg2 using "$dir3\education1_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)


///////////////////////////////////////////////////////////////////////////////
///juniour
areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB [aw=weight] if agey>11 & agey<=14, ab (ROB) cluster (ROB)
boottest shockc1=0 ,  nograph  
outreg2 using "$dir3\education1_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)

///////////////////////////////////////////////////////////////////////////////
///senoiur
areg ontrack shockc1  i.agey gender genderhd i.year i.YOB [aw=weight] if agey>14, ab ( ROB) cluster (ROB)
boottest shockc1=0 ,  nograph  
outreg2 using "$dir3\education1_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, No)


//////////////////////////////////////////////////////////////////////////////
///Panel D: with trend 
///all

areg ontrack shockc1  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight], ab ( ROB) cluster (ROB)
boottest shockc1=0 ,  nograph   

outreg2 using "$dir3\education1_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

/////////////////////////////////////////////////////////////////////////////
///primary

areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey<=11, ab (ROB) cluster (ROB)
boottest shockc1=0 ,  nograph  

outreg2 using "$dir3\education1_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///////////////////////////////////////////////////////////////////////////////
///juniour

areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>11 & agey<=14, ab (ROB) cluster (ROB)
boottest shockc1=0 ,  nograph   

outreg2 using "$dir3\education1_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///////////////////////////////////////////////////////////////////////////////
///senoiur

areg ontrack shockc1  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>14, ab (ROB) cluster (ROB)
boottest shockc1=0 ,  nograph  

outreg2 using "$dir3\education1_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

//////////////////////////////////////////////////////////////////////////////////////
**Table 2
****IV second stage 
//Attendance 
///Panel A: without trend 
ivreg2  attendance  (shockc=shocki) i.agey gender genderhd  i.YOB i.ROB i.year  [aw=weight] if agey>=6 & agey<=17,   cluster (ROB)  
boottest shockc=0 ,     nograph   

//gen smpl_1=0
//replace smpl_1=1 if e(sample)==1

//outreg2 using "$dir3\international_IV_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  attendance  (shockc=shocki ) i.agey gender genderhd  i.YOB i.ROB i.year  [aw=weight] if agey>=6 & agey<=11,   cluster (ROB)  
boottest shockc=0 ,    nograph  

//gen smpl_2=0
//replace smpl_2=1 if e(sample)==1

//outreg2 using "$dir3\international_IV_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  attendance  (shockc=shocki) i.agey gender genderhd  i.YOB i.ROB i.year  [aw=weight] if agey>=12 & agey<=14,   cluster (ROB)  
boottest shockc=0 ,    nograph  

//gen smpl_3=0
//replace smpl_3=1 if e(sample)==1

//outreg2 using "$dir3\international_IV_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  attendance  (shockc=shocki) i.agey gender genderhd  i.YOB i.ROB i.year  [aw=weight] if agey>=15 & agey<=17,   cluster (ROB)  
boottest shockc=0 ,     nograph  

//gen smpl_4=0
//replace smpl_4=1 if e(sample)==1

//outreg2 using "$dir3\international_IV_notrend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
///////////////////////////////////////////////////////////////////////////////

///Panel B: with trend
ivreg2  attendance  (shockc=shocki) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year  [aw=weight] if agey>=6 & agey<=17,   cluster (ROB)  
boottest shockc=0 ,     nograph   

//gen smpl_5=0
//replace smpl_5=1 if e(sample)==1


//outreg2 using "$dir3\international_IV_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  attendance  (shockc=shocki ) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year  [aw=weight] if agey>=6 & agey<=11,   cluster (ROB)  
boottest shockc=0 ,    nograph  

//gen smpl_6=0
//replace smpl_6=1 if e(sample)==1


//outreg2 using "$dir3\international_IV_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  attendance  (shockc=shocki) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year  [aw=weight] if agey>=12 & agey<=14,   cluster (ROB)  
boottest shockc=0 ,    nograph  

//gen smpl_7=0
//replace smpl_7=1 if e(sample)==1

//outreg2 using "$dir3\international_IV_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  attendance  (shockc=shocki) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year  [aw=weight] if agey>=15 & agey<=17,   cluster (ROB)  
boottest shockc=0 ,     nograph  

//gen smpl_8=0
//replace smpl_8=1 if e(sample)==1

//outreg2 using "$dir3\international_IV_trend.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
///////////////////////////////////////////////////////////////////////////////
///Ontrack
///Panel C: without trend 
ivreg2  ontrack  (shockc1=shocki1 ) i.agey gender genderhd   i.YOB i.ROB i.year [aw=weight] if agey>=6 & agey<=17,   cluster (ROB)  
//boottest shockc1=0 ,     nograph  
//gen smpl_9=0
//replace smpl_9=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  ontrack  (shockc1=shocki1) i.agey gender genderhd   i.YOB i.ROB i.year [aw=weight] if agey>=6 & agey<=11,   cluster (ROB)  
//boottest shockc1=0 ,     nograph 
//gen smpl_10=0
//replace smpl_10=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  ontrack  (shockc1=shocki1) i.agey gender genderhd   i.YOB i.ROB i.year [aw=weight] if agey>=12 & agey<=14,  cluster (ROB)  

//boottest shockc1=0 ,     nograph  

//gen smpl_11=0
//replace smpl_11=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  ontrack  (shockc1=shocki1) i.agey gender genderhd   i.YOB i.ROB i.year  [aw=weight] if agey>=15 & agey<=17,   cluster (ROB)  
//boottest shockc1=0 ,     nograph  

//gen smpl_12=0
//replace smpl_12=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_notrend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
//////////////////////////////////////////////////////////////////////////////////

///Panel D: with trend 
ivreg2  ontrack  (shockc1=shocki1 ) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year [aw=weight] if agey>=6 & agey<=17,   cluster (ROB)  
//boottest shockc1=0 ,     nograph  

//gen smpl_13=0
//replace smpl_13=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  ontrack  (shockc1=shocki1) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year [aw=weight] if agey>=6 & agey<=11,   cluster (ROB)  
// shockc1=0 ,     nograph 

//gen smpl_14=0
//replace smpl_14=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  ontrack  (shockc1=shocki1) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year [aw=weight] if agey>=12 & agey<=14,  cluster (ROB)  
//boottest shockc1=0 ,     nograph  

//gen smpl_15=0
//replace smpl_15=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

ivreg2  ontrack  (shockc1=shocki1) i.agey gender genderhd  i.ROB#c.year i.YOB i.ROB i.year  [aw=weight] if agey>=15 & agey<=17,   cluster (ROB)  
//boottest shockc1=0 ,     nograph  

//gen smpl_16=0
//replace smpl_16=1 if e(sample)==1

//outreg2 using "$dir3\ontrack_IV_trend.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
************************************************************************************
//Table B.1

global des_control1 "attendance  ontrack  agey gender genderhd year"

keep if attendance!=.
eststo A: estpost summarize $des_control1 
eststo B: estpost summarize $des_control1 if agey<=11
eststo C: estpost summarize $des_control1 if  agey>11 & agey<=14
eststo D: estpost summarize $des_control1 if agey>14
esttab A B C D using "$dir3\Summary_school.tex", replace  main(mean %6.2f sd ) aux(count) mtitle("Total sample" "Primary" "Juniour High" "Senior High")
esttab A B C D using "$dir3\Summary_school.tex", replace label cell(" mean(fmt(3)) sd(fmt(3)) count(fmt(0))") mtitle("Total sample" "Primary" "Juniour High" "Senior High")
/////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
//Table C.1
//Attendance 
//first stage
///Panel A: without trend 
areg shockc shocki  i.agey gender genderhd  i.YOB  i.year  [aw=weight] if agey>=6 & agey<=17 & smpl_1==1, ab(ROB)  cluster (ROB)  

outreg2 using "$dir3\international_first_stage_0.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc shocki i.agey gender genderhd  i.YOB  i.year  [aw=weight] if agey>=6 & agey<=11 & smpl_2==1,   ab(ROB)  cluster (ROB)    

outreg2 using "$dir3\international_first_stage_0.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc shocki i.agey gender genderhd  i.YOB  i.year  [aw=weight] if agey>=12 & agey<=14 & smpl_3==1,   ab(ROB)  cluster (ROB)  

outreg2 using "$dir3\international_first_stage_0.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc shocki  i.agey gender genderhd i.YOB i.year  [aw=weight] if agey>=15 & agey<=17 & smpl_4==1,   ab(ROB)  cluster (ROB)   

outreg2 using "$dir3\international_first_stage_0.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///////////////////////////////////////////////////////////////////////////////////////////////
///Panel B: with trend 

areg shockc shocki  i.agey gender genderhd  i.ROB#c.year i.YOB  i.year  [aw=weight] if agey>=6 & agey<=17 & smpl_5==1, ab(ROB)  cluster (ROB)  

outreg2 using "$dir3\international_first_stage_1.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc shocki i.agey gender genderhd  i.ROB#c.year i.YOB  i.year  [aw=weight] if agey>=6 & agey<=11 & smpl_6==1,   ab(ROB)  cluster (ROB)    

outreg2 using "$dir3\international_first_stage_1.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc shocki i.agey gender genderhd  i.ROB#c.year i.YOB  i.year  [aw=weight] if agey>=12 & agey<=14 & smpl_7==1,   ab(ROB)  cluster (ROB)  

outreg2 using "$dir3\international_first_stage_1.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc shocki  i.agey gender genderhd  i.ROB#c.year i.YOB i.year  [aw=weight] if agey>=15 & agey<=17 & smpl_8==1,   ab(ROB)  cluster (ROB)   

outreg2 using "$dir3\international_first_stage_1.tex", keep(shocki) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///////////////////////////////////////////////////////////////////////////////////////////////
///Ontrack 
//first stage 
///first stage
///Panel C: without trend 

areg   shockc1 shocki1  i.agey gender genderhd  i.YOB   i.year [aw=weight] if agey>=6 & agey<=17 & smpl_9==1,  ab(ROB) cluster (ROB) 
outreg2 using "$dir3\international_first_stage_2.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg shockc1 shocki1  i.agey gender genderhd  i.YOB  i.year [aw=weight] if agey>=6 & agey<=11 & smpl_10==1,  ab(ROB) cluster (ROB)  

outreg2 using "$dir3\international_first_stage_2.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc1 shocki1  i.agey gender genderhd  i.YOB  i.year  [aw=weight] if agey>=12 & agey<=14 & smpl_11==1,  ab(ROB) cluster (ROB)  

outreg2 using "$dir3\international_first_stage_2.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg shockc1 shocki1  i.agey gender genderhd  i.YOB  i.year [aw=weight] if agey>=15 & agey<=17 & smpl_12==1,  ab(ROB) cluster (ROB)  

outreg2 using "$dir3\international_first_stage_2.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

/////////////////////////////////////////////////////////////////////////////
///Panel D: with trend 

areg   shockc1 shocki1  i.agey gender genderhd  i.ROB#c.year i.YOB   i.year [aw=weight] if agey>=6 & agey<=17 & smpl_13==1,   ab(ROB) cluster (ROB)  
outreg2 using "$dir3\international_first_stage_3.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg shockc1 shocki1  i.agey gender genderhd  i.ROB#c.year i.YOB i.year [aw=weight] if agey>=6 & agey<=11 & smpl_14==1,   ab(ROB) cluster (ROB)  

outreg2 using "$dir3\international_first_stage_3.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg  shockc1 shocki1  i.agey gender genderhd  i.ROB#c.year  i.YOB i.year  [aw=weight] if agey>=12 & agey<=14 & smpl_15==1,   ab(ROB) cluster (ROB)  

outreg2 using "$dir3\international_first_stage_3.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg shockc1 shocki1  i.agey gender genderhd  i.ROB#c.year i.YOB i.year [aw=weight] if agey>=15 & agey<=17 & smpl_16==1,   ab(ROB) cluster (ROB)  

outreg2 using "$dir3\international_first_stage_3.tex", keep(shocki1) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
 
////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Table D.3
//Rainfall control
//Panle A: Attendance
areg attendance shockc  avg_rain i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] , ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph   

outreg2 using "$dir3\educationrain.tex", keep(shockc avg_rain ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc avg_rain i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey<=11, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\educationrain.tex", keep(shockc avg_rain ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc avg_rain  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey>11 & agey<=14, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph   

outreg2 using "$dir3\educationrain.tex", keep(shockc avg_rain ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc avg_rain i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey>14, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  

outreg2 using "$dir3\educationrain.tex", keep(shockc avg_rain ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

////////////////////////////////////////////////////////////////////////////////
///Panle B: Grade-for-age//ontrack

areg ontrack shockc1 avg_rain1 i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] , ab ( ROB) cluster (ROB)
boottest shockc1=0 ,  nograph 

outreg2 using "$dir3\educationrain1.tex", keep(shockc1 avg_rain1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  avg_rain1 i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey<=11, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  

outreg2 using "$dir3\educationrain1.tex", keep(shockc1 avg_rain1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1 avg_rain1  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey>11 & agey<=14, ab ( ROB) cluster (ROB)
boottest shockc1=0 ,  nograph  

outreg2 using "$dir3\educationrain1.tex", keep(shockc1 avg_rain1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1 avg_rain1  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey>14, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  

outreg2 using "$dir3\educationrain1.tex", keep(shockc1 avg_rain1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
///Table D.8
///Intensity of cocoa prodution
//Panle A: Attendance

areg attendance shock_intens  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight], ab ( ROB ) cluster (ROB)
boottest shock_intens=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity.tex", keep(shock_intens ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shock_intens  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey<=11, ab ( ROB) cluster (ROB)
boottest shock_intens=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity.tex", keep(shock_intens ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shock_intens   i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>11 & agey<=14, ab ( ROB) cluster (ROB)
boottest shock_intens=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity.tex", keep(shock_intens ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shock_intens   i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>14, ab ( ROB ) cluster (ROB)
boottest shock_intens=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity.tex", keep(shock_intens ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
/////////////////////////////////////////////////////////////////////////////////
//Panle B: Grade-for-age//ontrack

areg ontrack shock_intens1  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight], ab ( ROB) cluster (ROB)
boottest shock_intens1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity1.tex", keep(shock_intens1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shock_intens1  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey<=11, ab ( ROB) cluster (ROB)
boottest shock_intens1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity1.tex", keep(shock_intens1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shock_intens1  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>11 & agey<=14, ab ( ROB) cluster (ROB)
boottest shock_intens1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity1.tex", keep(shock_intens1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shock_intens1   i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>14, ab ( ROB) cluster (ROB)
boottest shock_intens1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\intensity1.tex", keep(shock_intens1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///Table D.10:
///Drop Acra and Volta
///Panel A: Attendance
drop if region==3
drop if region ==4


areg attendance shockc  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight], ab ( ROB   ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey<=11, ab ( ROB   ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>11 & agey<=14, ab ( ROB   ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>14, ab ( ROB   ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
/////////////////////////////////////////////////////////////////////////////////
//Panel B: grade-for-age//ontrack

areg ontrack shockc1  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight], ab ( ROB   ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey<=11, ab ( ROB   ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>11 & agey<=14, ab ( ROB   ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>14, ab ( ROB   ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\noacranovoltaeducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
//////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////
///Table D.12
//High price vs low price
use "$dir1\schooling_final_data", clear
///Pnel A: attendance
label var shockboom "High Price X Cocoa_producer"
label var shockrecesion "Low Price X Cocoa_producer"

areg attendance shockboom shockrecesion i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight], ab ( ROB   ) cluster (ROB)
boottest shockboom=0 ,  nograph  seed(321448699) 

boottest shockrecesion=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\education_postive.tex", keep(shockboom shockrecesion   ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockboom  shockrecesion i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey<=11, ab ( ROB   ) cluster (ROB)

boottest shockboom=0 ,  nograph  seed(321448699) 

boottest shockrecesion=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\education_postive.tex", keep(shockboom shockrecesion   ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockboom  shockrecesion  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>11 & agey<=14, ab ( ROB   ) cluster (ROB)

boottest shockboom=0 ,  nograph  seed(321448699) 

boottest shockrecesion=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\education_postive.tex", keep(shockboom shockrecesion   ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockboom  shockrecesion i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey>14, ab ( ROB   ) cluster (ROB)

boottest shockboom=0 ,  nograph  seed(321448699) 

boottest shockrecesion=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\education_postive.tex", keep(shockboom shockrecesion   ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
////////////////////////////////////////////////////////

///Pnel B: grade-for-age//ontrack

label var shockboom1 "High Price X Cocoa_producer"
label var shockrecesion1 "Low Price X Cocoa_producer"

areg ontrack shockboom1 shockrecesion1  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] , ab ( ROB   ) cluster (ROB)
boottest shockboom1=0 ,  nograph  seed(321448699) 

boottest shockrecesion1=0 ,  nograph  seed(321448699) 
outreg2 using "$dir3\education_positive1.tex", keep(shockboom1 shockrecesion1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockboom1  shockrecesion1  i.agey  gender genderhd i.year i.ROB#c.year i.YOB [aw=weight] if agey<=11, ab ( ROB   ) cluster (ROB)
boottest shockboom1=0 ,  nograph  seed(321448699) 

boottest shockrecesion1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\education_positive1.tex", keep(shockboom1 shockrecesion1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockboom1  shockrecesion1  i.agey  gender genderhd  i.year i.ROB#c.year i.YOB [aw=weight]  if agey>11 & agey<=14, ab ( ROB   ) cluster (ROB)
boottest shockboom1=0 ,  nograph  seed(321448699) 

boottest shockrecesion1=0 ,  nograph  seed(321448699) 
outreg2 using "$dir3\education_positive1.tex", keep(shockboom1 shockrecesion1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockboom1  shockrecesion1  i.agey gender genderhd i.year i.ROB#c.year i.YOB [aw=weight]  if agey>14, ab ( ROB   ) cluster (ROB)
boottest shockboom1=0 ,  nograph  seed(321448699) 

boottest shockrecesion1=0 ,  nograph  seed(321448699) 
outreg2 using "$dir3\education_positive1.tex", keep(shockboom1 shockrecesion1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///Table D.15
////////Hetrognity by gender
//Panel A: Attendance

areg attendance shockc i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if gender==1, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


areg attendance shockc i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey<=11 &gender==1, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>11 & agey<=14 &gender==1, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>14 &gender==1, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)
///////////////////////////////////////////////////////////////////////////////

////
areg attendance shockc  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if gender==0, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg attendance shockc  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey<=11 & gender==0, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


areg attendance shockc  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>11 & agey<=14 &gender==0, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


areg attendance shockc  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>14 &gender==0, ab ( ROB ) cluster (ROB)
boottest shockc=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation.tex", keep(shockc ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

///Panel B: grade-for-age//ontrack

areg ontrack shockc1  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if gender==1, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey<=11 &gender==1, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>11 & agey<=14 &gender==1, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>14 &gender==1, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


////
areg ontrack shockc1  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if gender==0, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey<=11 &gender==0, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


areg ontrack shockc1  i.agey  gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>11 & agey<=14 &gender==0, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)


areg ontrack shockc1  i.agey gender genderhd i.year i.YOB i.ROB#c.year [aw=weight] if agey>14 &gender==0, ab ( ROB ) cluster (ROB)
boottest shockc1=0 ,  nograph  seed(321448699) 

outreg2 using "$dir3\gendereducation1.tex", keep(shockc1 ) stats(coef se) bdec(3) sdec(3) nocons  label addtext(Region FE, Yes, Survey year FE, Yes, Region time trends, Yes)

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////










